import { IAccount, ILoginResult } from './type'
import myRequest from '../index'
import { IDataType } from '../types'

enum LoginApi {
  accountLogin = '/login',
  userMenus = '/mian/menus'
}
//登录
const accountLoginRequest = (account: IAccount) => {
  return myRequest.post<IDataType<ILoginResult>>({
    url: LoginApi.accountLogin,
    data: account,

    params: account
  })
}

//用户菜单树
const requestUserMenusByRoleId = () => {
  return myRequest.post<IDataType>({
    url: LoginApi.userMenus,
    showLoading: false
  })
}

export { accountLoginRequest, requestUserMenusByRoleId }
